package com.chenjun.core.dao.generator.mapper;

import com.chenjun.core.dao.generator.entity.OaBillAttnMonthReportDtl;
import com.chenjun.core.dao.generator.entity.OaBillAttnMonthReportDtlExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface OaBillAttnMonthReportDtlMapper {
    @Delete({
        "delete from oa_bill_attn_month_report_dtl",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    @Insert({
        "insert into oa_bill_attn_month_report_dtl (id, bill_id, ",
        "report_key, report_val)",
        "values (#{id,jdbcType=INTEGER}, #{billId,jdbcType=INTEGER}, ",
        "#{reportKey,jdbcType=VARCHAR}, #{reportVal,jdbcType=REAL})"
    })
    int insert(OaBillAttnMonthReportDtl record);

    int insertSelective(OaBillAttnMonthReportDtl record);

    List<OaBillAttnMonthReportDtl> selectByExample(OaBillAttnMonthReportDtlExample example);

    @Select({
        "select",
        "id, bill_id, report_key, report_val",
        "from oa_bill_attn_month_report_dtl",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("BaseResultMap")
    OaBillAttnMonthReportDtl selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(OaBillAttnMonthReportDtl record);

    @Update({
        "update oa_bill_attn_month_report_dtl",
        "set bill_id = #{billId,jdbcType=INTEGER},",
          "report_key = #{reportKey,jdbcType=VARCHAR},",
          "report_val = #{reportVal,jdbcType=REAL}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(OaBillAttnMonthReportDtl record);
}